package org.dzq.designmode.factory.abstractfactory;

import org.dzq.designmode.factory.abstractfactory.bean.HuaWeiRouter;
import org.dzq.designmode.factory.abstractfactory.bean.Phone;
import org.dzq.designmode.factory.abstractfactory.bean.Router;

/**
 * @ClassName: AbstractFactoryTest
 * @Package: org.dzq.designmode.factory.abstractfactory
 * @author: 越
 * @date: 2023/6/12 22:57
 * @Description:
 */
public class AbstractFactoryTest {
    public static void main(String[] args) {
        AbstractFactory huaWeiFactory = new HuaWeiFactory();
        Phone huaWeiPhone = huaWeiFactory.getPhone();
        Router huaWeiRouter = huaWeiFactory.getRouter();
        huaWeiPhone.call();
        huaWeiRouter.connectNet();
        AbstractFactory xiaoMiFactory= new XiaoMiFactory();
        Phone xiaoMiPhone = xiaoMiFactory.getPhone();
        Router xiaoMiRouter = xiaoMiFactory.getRouter();
        xiaoMiPhone.call();
        xiaoMiRouter.connectNet();
    }
}
